<?php
/*##################################################
# 模块功能：保存功能配置
###################################################*/
 require_once('class.db.php');
 session_start(); 
 if(isset($_SESSION['lock_config'])){ $time=(int)$_SESSION['lock_config']-(int)time(); if($time>0){ exit(json_encode(array('success'=>0,'icon'=>5,'msg'=>"请勿频繁提交，".$time."秒后再试！")));}}
 $_SESSION['lock_config']= time()+ $from_timeout;

 $lywq['AntiRed']['status'] = filter_input(INPUT_POST, "lywq_AntiRed_status");
 $lywq['AntiRed']['terminal'] = implode("|", $_POST['lywq_AntiRed_terminal']);
 $lywq['AntiRed']['fpb']['type'] = filter_input(INPUT_POST, "lywq_AntiRed_fpb_type");
 $lywq['AntiRed']['fpb']['image'] = filter_input(INPUT_POST, "lywq_AntiRed_fpb_image");
 $lywq['AntiRed']['fpb']['link'] = filter_input(INPUT_POST, "lywq_AntiRed_fpb_link");
 $lywq['AntiRed']['fpb']['text'] = filter_input(INPUT_POST, "lywq_AntiRed_fpb_text");
 $lywq['AntiRed']['fpb']['domain'] = filter_input(INPUT_POST, "lywq_AntiRed_fpb_domain");
 
 $lywq['autoCopy']['status'] = filter_input(INPUT_POST, "lywq_autoCopy_status");
 $lywq['autoCopy']['text'] = filter_input(INPUT_POST, "lywq_autoCopy_text");
 $lywq['autoCopy']['jump']['type'] = filter_input(INPUT_POST, "lywq_autoCopy_jump_type");
 $lywq['autoCopy']['jump']['time'] = filter_input(INPUT_POST, "lywq_autoCopy_jump_time");

if( Main_db::save()){
	exit(json_encode(array('success'=>1,'icon'=>1,'msg'=>"保存成功!")));
}else{
	exit(json_encode(array('success'=>0,'icon'=>0,'msg'=>"保存失败!请检测配置文件权限")));
} 

?>